/**
 * Created by jiaji on 2017/1/4.
 */
import send from './http'
export default {
  initHeartBeat (data) {
    return send.fetchByJsonp(data)
  },
  getPushOnlineAgentAndDealingCount (data) {
    let req = {
      data: data,
      action: 'app.monitor.getMultiMonitorData'
    }
    return send.fetch(req, 'post')
  },
  queryMonitorAgentTopData (data) {
    let req = {
      data: data,
      action: 'monitor.queryMonitorAgentTopData'
    }
    return send.fetchByReport(req, 'post', true)
  },
  queryMonitorInitData (data) {
    let req = {
      data: data,
      action: 'monitor.queryMonitorInitData'
    }
    return send.fetchByReport(req, 'post')
  },
  /**
   * 1.点击座席状态日志链接(操作查看对应的响应事件)
   * @param data
   * data:{"BEGIN_TIME":"2017-09-14 00:00:00",  起始时间
   * "END_TIME":"2017-09-14 23:59:59",          终止时间
   * "pageSize":10,                             每页显示条数
   * "ACTION_TYPE":"login"}                     日志类型
   * 2.点击查询按钮的响应事件（走的是统一方法，参数个数不同）
   * data:{"AGENT":"5e87f760-2217-11e6-9ec7-b101597a9db6",  当前登录座席
   * "includeSubordinate":false,                            显示已选座席下级
   * "BEGIN_TIME":"2017-09-14 00:00:00",
   * "END_TIME":"2017-09-14 23:59:59",
   * "reportType":"call_report_agent",
   * "selectedAgent":"5e87f760-2217-11e6-9ec7-b101597a9db6",所选座席
   * "StartingAndEndingTime":false,                         仅显示最初登录时间和最后退出时间
   * "pageSize":10,
   * "ACTION_TYPE":"login"}
   * 3.查看对应的参数格式
   * data:{"BEGIN_TIME":"2017-09-14 15:44:38",
   * "END_TIME":"null",
   * "pageSize":10,
   * "AGENT":"1e3c34d0-2930-11e6-b8cf-a923f8fdcf8e",
   * "ACTION_TYPE":"busy"}
   * 4.翻页对应的参数格式：
   * data:{"AGENT":"",
   * "includeSubordinate":false,
   * "BEGIN_TIME":"2017-09-01 00:00:00",
   * "END_TIME":"2017-09-14 23:59:59",
   * "reportType":"call_report_agent",
   * "selectedAgent":"",
   * "StartingAndEndingTime":false,
   * "page":"2",     页码
   * "pageSize":10,
   * "ACTION_TYPE":"login"}
   * @returns {*}
   * 5. 仅显示最初登录时间和最后退出时间参数格式
   * data:{"AGENT":"",
   * "includeSubordinate":false,
   * "BEGIN_TIME":"2017-09-01 00:00:00",
   * "END_TIME":"2017-09-14 23:59:59",
   * "reportType":"call_report_agent",
   * "selectedAgent":"",
   * "StartingAndEndingTime":false,
   * "pageSize":10,
   * "ACTION_TYPE":"login"}
   */
  queryCdrPeer (data) {
    let req = {
      data: data,
      action: 'app.monitor.queryCdrPeer'
    }
    return send.fetch(req, 'post')
  },
  getBusyCdrPeer (data) {
    let req = {
      data: data,
      action: 'app.monitor.getBusyCdrPeer'
    }
    return send.fetch(req, 'post')
  },
  getCdrPeerStatusDetails (data) {
    let req = {
      data: data,
      action: 'app.monitor.getCdrPeerStatusDetails'
    }
    return send.fetch(req, 'post')
  },
  getCdrPeerSummary (data) {
    let req = {
      data: data,
      action: 'app.monitor.getCdrPeerSummary'
    }
    return send.fetch(req, 'post')
  },
  queryImStatusLogReport (data) {
    let req = {
      data: data,
      action: 'monitor.queryImStatusLogReport'
    }
    return send.fetchByReport(req, 'post')
  },
  getImStatusDetails (data) {
    let req = {
      data: data,
      action: 'app.monitor.getImStatusDetails'
    }
    return send.fetch(req, 'post')
  },
  getLoginStatusLogs (data) {
    let req = {
      data: data,
      action: 'app.monitor.getLoginStatusLogs'
    }
    return send.fetch(req, 'post')
  },
  getMoreStatusLogs (data) {
    let req = {
      data: data,
      action: 'app.monitor.getMoreStatusLogs'
    }
    return send.fetch(req, 'post')
  },
  getlogincdrpeer (data) {
    let req = {
      data: data,
      action: 'app.monitor.getLoginCdrPeer'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 导出excel和导出详细excel
   * data:{"Method":"exportCdrPeerDetail",   导出类型
 * "Query":                                查询条件
 * {"AGENT":"",
 * "includeSubordinate":false,
 * "BEGIN_TIME":{"$gte":"2017-09-14 00:00:00","$lte":"2017-09-14 23:59:59"},
 * "END_TIME":"2017-09-14 23:59:59",
 * "reportType":"call_report_agent",
 * "selectedAgent":"5e87f760-2217-11e6-9ec7-b101597a9db6",
 * "StartingAndEndingTime":false,
 * "ASTERISK":"1.1.1.101",
 * "ACTION_TYPE":"login",
 * "accountId":"N00000000500",
 * "dataDB":"cc_data_20140728",
 * "type":"ReportCdrPeerExport",
 * "user":"1e3c34d0-2930-11e6-b8cf-a923f8fdcf8e",
 * "userType":"manager",
 * "queryArry":""}}
   * 导出excel参数格式：
   * data:{"Method":"exportCdrPeer",
 * "Query":{"AGENT":"",
 * "includeSubordinate":false,
 * "BEGIN_TIME":{"$gte":"2017-09-14 00:00:00","$lte":"2017-09-14 23:59:59"},
 * "END_TIME":"2017-09-14 23:59:59",
 * "reportType":"call_report_agent",
 * "selectedAgent":"5e87f760-2217-11e6-9ec7-b101597a9db6",
 * "StartingAndEndingTime":false,
 * "queryArry":"",
 * "accountId":"N00000000500",
 * "dataDB":"cc_data_20140728",
 * "ASTERISK":"1.1.1.101","ACTION_TYPE":"login"}}
   * @returns {openNum:0, todoNum:0}
   */
  exportCdrPeer (data) {
    let req = {
      data: data,
      action: 'app.excel.exportXls'
    }
    return send.fetch(req, 'post')
  },
  updateMonitorConfig (data) {
    let req = {
      data: data,
      action: 'app.monitor.updateMonitorConfig'
    }
    return send.fetch(req, 'post')
  },
  removeMonitorConfig (data) {
    let req = {
      data: data,
      action: 'app.monitor.removeMonitorConfig'
    }
    return send.fetch(req, 'post')
  },
  getMonitorList (data) {
    let req = {
      data: data,
      action: 'app.monitor.getMonitorList'
    }
    return send.fetch(req, 'post')
  },
  showMonitorConfig (data) {
    let req = {
      data: data,
      action: 'app.monitor.showMonitorConfig'
    }
    return send.fetch(req, 'post')
  },
  getUserMonitorList (data) {
    let req = {
      data: data,
      action: 'app.monitor.getUserMonitorList'
    }
    return send.fetch(req, 'post')
  },
  queryAccountMoniterBusyNotice (data) {
    let req = {
      data: data,
      action: 'config.ivr.pbx.queryAccountMoniterBusyNotice'
    }
    return send.fetch(req, 'post')
  },
  updateAccountMoniterBusyNotice (data) {
    let req = {
      data: data,
      action: 'config.ivr.pbx.updateAccountMoniterBusyNotice'
    }
    return send.fetch(req, 'post')
  },
  getRemoteControlMonitorInfo (data) {
    let req = {
      data: data,
      action: 'app.remoteassist.getMonitorInfo'
    }
    return send.fetch(req, 'post')
  },
  getRemoteControlMonitorList (data) {
    let req = {
      data: data,
      action: 'app.remoteassist.getMonitorList'
    }
    return send.fetch(req, 'post')
  },
  getCallInDataIn6Hours (data) {
    let req = {
      data: data,
      action: 'app.monitor.getCallInDataIn6Hours'
    }
    return send.fetch(req, 'post', true)
  },
  queryMonitorWarningCfg (data) {
    let req = {
      data: data,
      action: 'app.monitor.queryMonitorWarningCfg'
    }
    return send.fetch(req, 'post')
  },
  updateMonitorWarningCfg (data) {
    let req = {
      data: data,
      action: 'app.monitor.updateMonitorWarningCfg'
    }
    return send.fetch(req, 'post')
  },
  getAdvisoryChannelCount (data) {
    let req = {
      data: data,
      action: 'app.monitor.getAdvisoryChannelCount'
    }
    return send.fetch(req, 'post', true)
  },
  getCallInAreaData (data) {
    let req = {
      data: data,
      action: 'app.monitor.getCallInAreaData'
    }
    return send.fetch(req, 'post', true)
  },
  getProvinceCodes (data) {
    let req = {
      data: data,
      action: 'app.monitor.getProvinceCodes'
    }
    return send.fetch(req, 'post', true)
  },
  getWebChatDataIn6Hours (data) {
    let req = {
      data: data,
      action: 'app.monitor.getWebChatDataIn6Hours'
    }
    return send.fetch(req, 'post', true)
  },
  getMonitorSensitiveWordsHistory (data) {
    let req = {
      data: data,
      action: 'app.callSheet.getMonitorSensitiveWordsHistory'
    }
    return send.fetch(req, 'post', true)
  },
  updateMonitorQueueWarningCfg (data) {
    let req = {
      data: data,
      action: 'app.monitor.updateMonitorQueueWarningCfg'
    }
    return send.fetch(req, 'post', true)
  },
  queryMonitorQueueWarningCfg (data) {
    let req = {
      data: data,
      action: 'app.monitor.queryMonitorQueueWarningCfg'
    }
    return send.fetch(req, 'post', true)
  }
}
